﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;

namespace CC98.Xaml.Helpers
{
    public static class BindHelper
    {
        public static void Bind(object source, PropertyPath sourcePropertyPath, FrameworkElement target, DependencyProperty targetProperty)
        {
            Binding binding = new Binding()
            {
                Source = source,
                Path = sourcePropertyPath,
                Mode = BindingMode.TwoWay
            };

            target.SetBinding(targetProperty, binding);
        }
    }
}
